#!/bin/bash

# remove the previous installation
./deploy1.sh_cleanup

cd $(adapt query self bld)

# everything here would be in adapt, but I do not want to complicate now

transf_opts=$(adapt oop self decode_options)

<install_manifest.txt xargs -L1 rm
rm -rf CMake*

adapt cmake \
  -D CMAKE_CXX_FLAGS=-DNDEBUG \
  -D CMAKE_BUILD_TYPE:STRING=RELEASE \
  -D CMAKE_INSTALL_PREFIX:PATH=$(adapt query sys/prefix) \
  -D LifeV_ENABLE_Core:BOOL=ON \
  $transf_opts \
  ..

echo adapt cmake \
  -D CMAKE_CXX_FLAGS=-DNDEBUG \
  -D CMAKE_BUILD_TYPE:STRING=RELEASE \
  -D CMAKE_INSTALL_PREFIX:PATH=$(adapt query sys/prefix) \
  -D LifeV_ENABLE_Core:BOOL=ON \
  -D LifeV_ENABLE_NavierStokes:BOOL=ON \
  -D LifeV_ENABLE_Operator:BOOL=ON \
  -D LifeV_ENABLE_ECM2:BOOL=ON $fix \
  ..

#  -D Trilinos_DIR=/home/jaross/adapt/soft/lib/cmake/Trilinos \
adapt make -j $(adapt query sys/cpunum)

adapt make install

adapt register self installed=yes
